# -*- coding:utf-8 -*-
"""
Author：Administrator
Date:2023年03月17日
"""
import openpyxl

myBook = openpyxl.load_workbook('收入表.xlsx')
mySheet=myBook.active
myRange = mySheet.iter_cols(min_row=5,min_col=2,max_row=8,max_col=4)
myNewRow=['合计']
for myCol in myRange:
	myColSum=sum([myCell.value for myCell in myCol])
	myNewRow.append(myColSum)
mySheet.append(myNewRow)
myBook.save('收入表.xlsx')
